class Pato {
    def quack() { println "Soy un pato" }
}

class Rana {
    def quack() { println "Soy una rana" }
}

def quackers = [new Pato(), new Rana()]
for (q in quackers) {
    q.quack()
}